import { readFile, updateResFile } from '../util/file'
import {status} from "../data/status";
const statusLocation = `${__dirname}/../data/status.json`

// 获取所有目录
export const getLockStatus = async () => {
  return await readFile(statusLocation)
}
// 设置锁的状态
export const setLockStatus = async ({isLock}) => {
  let status = await getLockStatus()
  status.isLock = isLock
  return await updateResFile(statusLocation, status)
}

export default {
  getLockStatus,
  setLockStatus
}
